Binocular stereopsis is the ability to use differences between the images[unreadable] presented to the two eyes (binocular disparities) to perceive the three[unreadable] dimensional structure of the outside world. In order to detect that an object[unreadable] has a binocular disparity, it is first necessary to correctly match up the[unreadable] images of that object in the two eyes (the stereo correspondence problem).[unreadable] Humans are able to do this very robustly, even when the two eyes are shown random patterns generated by computers (random dot stereograms). Understanding how this correspondence problem is solved by cortical neurons is excellent model system for studying how neuronal processing generates useful perceptual representations. [unreadable] [unreadable] We studied this with a combination of neuronal recordings and computer simulations. First, simulations showed that our current understanding of the mechanisms that generate disparity selective neurons make a curious prediction: the optimum stimulus for these cells never occurs in natural viewing. We tested this prediction in neurons recorded from the visual cortex of awake fixating monkeys, and found it to be true of approximately half the neurons. [unreadable] [unreadable] This striking failure to reflect the natural structure of binocular images may serve a useful function: these neurons are most activated when a stimulus falls on the two retinae that cannot be produced by a real 3D object. For exactly this reason these responses may help solve the correspondence problem. When these neurons are activated, the match at that disparity must be a false match. We were able to develop a very simple algorithm, based on this principle, that could be implemented simply using only model neurons with realistic behavior. We derived a proof that this algorithm always finds the correct match for simple cases in which the disparity is uniform. The algorithm also performed well on real stereo images. This work therefore provides an explanation for the observed nature of disparity coding in visual cortex, and shows how significant computational problems can be solved by interactions between cortical neurons.